home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-01-01 | 1.0 KB | 44 lines | [TEXT/MACA] |
- \ rfl an example of a window that is updated from an offscreen bitmap
- \ needs to have source 'offscreen' loaded first
-
- :CLASS copyWind <super window
-
- var myImage
-
- :M setImage: get: contRect destRect: [ obj: myImage ]
- ^base destPort: [ obj: myImage ] ;M
-
- :M DrawImage: draw: [ obj: myImage ] ;M
-
- :M new: heap> copier put: myImage
- new: super setImage: self new: [ obj: myImage ] ;M
-
- :M close: close: super close: [ obj: myImage ] dispose: myImage ;M
-
- :M save: save: [ obj: myImage ] ;M
-
- :M setBit: set: [ obj: myImage ] ;M
-
- ;CLASS
-
- \ copyWind bob
- \
- \ grayRgn true setDrag: bob
- \ false setGrow: bob \ since destRect is set by the contRect of bob, don't want
- \ \ it to grow after NEW:
- \
- \ : jj 100 100 300 300 put: temprect
- \ temprect " help" docwind 1 1 new: bob ;
- \
- \ updates will copybits to screen
- \ : drawBob drawImage: bob ;
- \
- \ 4 'cfas null null drawBob null actions: bob
- \
- \ to draw to the offscreen port, type
- \ setBit: bob
- \ then all output will go to the offscreen bitmap.
- \ To draw to the screen, type
- \ drawImage: bob
-
-